<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="/WEB-INF/jsp/common/head.jsp"%>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<div class="right">
       <div class="location">
           <strong>当前位置:</strong>
           <span>入库记录管理页面</span>
       </div>
       <div class="search">
       <form method="get" action="${pageContext.request.contextPath }/storageRecord/list">
			<span>商品名称：</span>
			<input name="queryGoodsName" type="text" value="${queryGoodsName }">
			<span>供货商：</span>

<%--			<select name="querySupplierId">--%>
<%--				   <option value="">--全部--</option>--%>
<%--				   <option ></option>--%>
<%--       		</select>--%>


		   <select name="querySupplierId">
			   <option value="">--全部--</option>
			   <!-- 假设您有一个名为suppliers的集合，它包含了所有的供货商信息 -->
			   <c:forEach var="supplier" items="${storageRecord}">
				   <option value="${supplier.supplierid}" ${querySupplierId == supplier.supplierid ? 'selected="selected"' : ''}>
						   ${supplier.supplier.supname} <!-- 假设每个供货商都有一个name属性 -->
				   </option>
			   </c:forEach>
		   </select>
			 
			<span>付款状态：</span>



			<select name="querypayStatus">
				<option value="">--全部--</option>
<%--				<c:forEach var="supplier" items="${storageRecord}">--%>
<%--					<option value="${supplier.paystatus}" ${queryPayStatus == supplier.paystatus ? 'selected="selected"' : ''}>--%>
<%--&lt;%&ndash;							${supplier.supplier.supname} <!-- 假设每个供货商都有一个name属性 -->&ndash;%&gt;--%>
<%--						<c:if test="${supplier.paystatus==1}" >--%>
<%--							未支付--%>
<%--						</c:if>--%>
<%--	<c:if test="${supplier.paystatus==2}" >--%>
<%--		已支付--%>
<%--	</c:if>--%>
<%--					</option>--%>
<%--				</c:forEach>--%>
				<option value="1" ${param.querypayStatus == 1 ? 'selected="selected"': ''}>未付款</option>
				<option value="2" ${param.querypayStatus == 2 ? 'selected="selected"': ''}>已付款</option>
       		</select>


		   <input type="hidden" name="pageIndex" value="1"/>
		   <input	value="查 询" type="submit" id="searchbutton">
			 <a href="${pageContext.request.contextPath }/storageRecord/toAdd">添加</a>
		</form>
       </div>
       <!--账单表格 样式和供货商公用-->
      <table class="supplierTable" cellpadding="0" cellspacing="0">
          <tr class="firstTr">
              <th width="15%">入库编号</th>
              <th width="10%">商品名称</th>
              <th width="10%">金额</th>
              <th width="20%">供货商</th>
              <th width="10%">付款状态</th>
              <th width="10%">创建时间</th>
              <th width="25%">操作</th>
          </tr>
		  <c:forEach items="${storageRecord}" var="storageRecord">
				<tr>
					<td>
					<span>${storageRecord.srcode}</span>
					</td>
					<td>
					<span>${storageRecord.goodsname}</span>
					</td>
					<td>
					<span>${storageRecord.totalamount}</span>
					</td>
					<td>
					<span>${storageRecord.supplier.supname}</span>
					</td>

					<td>
					<span>
						<c:if test="${storageRecord.paystatus==1}">
							未付款
						</c:if>
						<c:if test="${storageRecord.paystatus==2}">
							已付款
						</c:if>
					</span>
					</td>

					<td>
					<span>
					<fmt:formatDate value="${storageRecord.createdtime}" pattern="yyyy-MM-dd"/>
					</span>
					</td>
					<td>
					<span><a class="viewStorageRecord" href="javascript:;" storageRecordId=${storageRecord.id } StorageRecordcc=${storageRecord.srcode }  supName=${storageRecord.supplier.supname}>  <img src="${pageContext.request.contextPath }/statics/images/view.png" alt="查看" title="查看"/></a></span>
					<span><a class="modifyStorageRecord" href="javascript:;" storageRecordId=${storageRecord.id } StorageRecordcc=${storageRecord.srcode }  supName=${storageRecord.supplier.supname}><img src="${pageContext.request.contextPath }/statics/images/upd.png" alt="修改" title="修改"/></a></span>
					<span><a class="deleteStorageRecord" href="javascript:;" storageRecordId=${storageRecord.id } StorageRecordcc=${storageRecord.srcode } ><img src="${pageContext.request.contextPath }/statics/images/del.png" alt="删除" title="删除"/></a></span>
					</td>
				</tr>
		  </c:forEach>
      </table>
		<input type="hidden" id="totalPageCount" value="${totalPageCount}"/>
	<c:import url="/WEB-INF/jsp/sysRole/rollpage.jsp">
		<c:param name="totalCount" value="${totalCount}"/>
		<c:param name="currentPageNo" value="${currentPageNo}"/>
		<c:param name="totalPageCount" value="${totalPageCount}"/>
	</c:import>
  </div>
</section>

<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<div class="remove" id="removeBi">
    <div class="removerChid">
        <h2>提示</h2>
        <div class="removeMain">
            <p>确定删除该订单吗？</p>
            <a href="#" id="yes">是</a>
            <a href="#" id="no">否</a>
        </div>
    </div>
</div>

<%@include file="/WEB-INF/jsp/common/foot.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/storageRecord/list_1.js"></script>